package models

import "gorm.io/gorm"

type Shop struct {
	gorm.Model
	Id        int     `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Name      string  `gorm:"column:name" json:"name"`
	TypeId    int     `gorm:"column:type_id" json:"typeId"`
	Images    string  `gorm:"column:images" json:"images"`
	Area      string  `gorm:"column:area" json:"area"`
	Address   string  `gorm:"column:address" json:"address"`
	X         float64 `gorm:"column:x" json:"x"`
	Y         float64 `gorm:"column:y" json:"y"`
	AvgPrice  int     `gorm:"column:avg_price" json:"avgPrice"`
	Sold      int     `gorm:"column:sold" json:"sold"`
	Comments  int     `gorm:"column:comments" json:"comments"`
	Score     int     `gorm:"column:score" json:"score"`
	OpenHours string  `gorm:"column:open_hours" json:"openHours"`
	Distance  float64 `gorm:"-" json:"distance"`
}
type ShopVo struct {
	gorm.Model
	Id         int     `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Name       string  `gorm:"column:name" json:"name"`
	TypeId     int     `gorm:"column:type_id" json:"typeId"`
	Images     string  `gorm:"column:images" json:"images"`
	Area       string  `gorm:"column:area" json:"area"`
	Address    string  `gorm:"column:address" json:"address"`
	X          float64 `gorm:"column:x" json:"x"`
	Y          float64 `gorm:"column:y" json:"y"`
	AvgPrice   int     `gorm:"column:avg_price" json:"avgPrice"`
	Sold       int     `gorm:"column:sold" json:"sold"`
	Comments   int     `gorm:"column:comments" json:"comments"`
	Score      int     `gorm:"column:score" json:"score"`
	OpenHours  string  `gorm:"column:open_hours" json:"openHours"`
	CreateTime MyTime  `gorm:"column:created_at" json:"createTime"`
	UpdateTime MyTime  `gorm:"column:updated_at" json:"updateTime"`
	Distance   float64 `gorm:"-" json:"distance"`
}
type CacheShopVo struct {
	gorm.Model
	Id         int     `gorm:"column:id;primary_key;AUTO_INCREMENT" json:"id"`
	Name       string  `gorm:"column:name" json:"name"`
	TypeId     int     `gorm:"column:type_id" json:"typeId"`
	Images     string  `gorm:"column:images" json:"images"`
	Area       string  `gorm:"column:area" json:"area"`
	Address    string  `gorm:"column:address" json:"address"`
	X          float64 `gorm:"column:x" json:"x"`
	Y          float64 `gorm:"column:y" json:"y"`
	AvgPrice   int     `gorm:"column:avg_price" json:"avgPrice"`
	Sold       int     `gorm:"column:sold" json:"sold"`
	Comments   int     `gorm:"column:comments" json:"comments"`
	Score      int     `gorm:"column:score" json:"score"`
	OpenHours  string  `gorm:"column:open_hours" json:"openHours"`
	CreateTime MyTime  `gorm:"column:created_at" json:"createTime"`
	UpdateTime MyTime  `gorm:"column:updated_at" json:"updateTime"`
	Distance   float64 `gorm:"-" json:"distance"`
	ExpireTime int64
}

func (Shop) TableName() string {
	return "tb_shop"
}
func (ShopVo) TableName() string {
	return "tb_shop"
}
